/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.gr.jcash.util;

import br.com.gr.jcash.dmp.TipoCategoria;
import java.util.HashMap;

/**
 *
 * @author gelson
 */
public class MapaEnum {

    private static final HashMap<String, Enum> mapaEnum;

    static {
        mapaEnum = new HashMap<String, Enum>();
        inserirMapa(mapaEnum, TipoCategoria.values());
    }

    private static void inserirMapa(HashMap<String, Enum> mapaEnum, Enum[] values) {
        for (Enum e : values) {
            mapaEnum.put(e.toString(), e);
        }
    }

    public static Enum getEnum(String descricao) {
        return mapaEnum.get(descricao);
    }
}
